package com.wxxymakers.grademark.model.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wxxymakers.grademark.model.entity.WxItemRank;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface WxItemRankMapper extends BaseMapper<WxItemRank> {

    @Select("select * from wx_item_rank where item_id = #{itemId}")
    @ResultMap("com.wxxymakers.grademark.model.mapper.WxItemRankMapper.BaseResultMap")
    List<WxItemRank> selectByItemId(@Param("itemId") int itemId);

    WxItemRank selectByIdNJ(@Param("id") Integer id);

    @Select("SELECT COUNT( 1 ) FROM wx_item_rank WHERE item_id = #{itemId} AND name = #{name}")
    @ResultType(Integer.class)
    int countByItemIdAndName(@Param("itemId") int itemId, @Param("name") String name);
}